package org.swift.mashup.engine.concurrency.memory;

import java.util.BitSet;

public class MemoryType {
	private String name;
	private BitSet mask;
	private int id;
	private boolean publish = false;
	private boolean collect = false;
	 
	public MemoryType(){
	
	}
	public MemoryType(int id){
		this.setId(id);
		this.setMask(new BitSet());
		this.getMask().set(id);
	}
	public MemoryType(int id,String name){
		this.setId(id);
		this.setMask(new BitSet());
		this.getMask().set(id);
		this.setName(name);
	}
	public MemoryType(int id, BitSet mask){
		this.setId(id);
		this.setMask(mask);
	}
	public MemoryType(int id, BitSet mask, String name){
		this.setId(id);
		this.setMask(mask);
		this.setName(name);
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getCollectedTypeName(){
		String collectName = getName().replace(" ", "");
		collectName = collectName.replace("collect(", "");
		collectName = collectName.replace(")", "");
		return collectName;
	}
	public BitSet getMask() {
		return mask;
	}
	public void setMask(BitSet mask) {
		this.mask = mask;
	}
	/**
	 * Getter of the property <tt>id</tt>
	 *
	 * @return Returns the id.
	 * 
	 */
	public int getId()
	{
		return id;
	}
	
	/**
	 * Setter of the property <tt>id</tt>
	 *
	 * @param id The id to set.
	 *
	 */
	public void setId(int id ){
		this.id = id;
	}
	public boolean isPublish() {
		return publish;
	}
	public void setPublish(boolean publish) {
		this.publish = publish;
	}
	public boolean isCollect() {
		return collect;
	}
	public void setCollect(boolean collect) {
		this.collect = collect;
	}
}
